<template>
  <div class="hea-top">
    <div class="header-top">
      <div class="top-img" @click="goHome()">
        <el-image class="imgstyle" :src="logow" fit="cover" />
      </div>
      <div @click="showNav">
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 62 62" class="right-btn" v-show="!isShowNav">
          <path stroke="currentColor" stroke-miterlimit="10" stroke-width="8" d="M0 30.8h62M0 4h62M0 57.6h62">
          </path>
        </svg>
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 65 60"  class="right-btn" v-show="isShowNav">
          <path stroke="currentColor" stroke-miterlimit="10" stroke-width="8" d="M31 30h1M3 3l59 54M3 56.6 62 3">
          </path>
        </svg>
      </div>
    </div>
  </div>

  <div class="nav-list" v-show="isShowNav" :class="isShowNav ? 'show-nav' : ''">
    <div class="nav-i" @click="routerHandle('work')">
      WORK 案例
    </div>
    <div class="nav-i" @click="routerHandle('about')">
      ABOUT 关于
    </div>
    <div class="nav-i" @click="routerHandle('service')">
      SERVICE 服务
    </div>
    <div class="nav-i" @click="routerHandle('contact')">
      CONTACT 联系
    </div>
  </div>
</template>

<script>
import logow from "@/assets/imgs/logow.png";
export default {
  name: "headerTop",
  props: {

  },
  data() {
    return {
      logow,
      routerName: "home",
      isShowNav: false,
    };
  },

  mounted() {
    this.routerName = this.$route.name;
  },

  methods: {
    showNav() {
      this.isShowNav = !this.isShowNav
      if (this.isShowNav) {
        document.body.classList.add('no-scroll');
      } else {
        document.body.classList.remove('no-scroll');
      }
    },
    goHome() {
      this.$router.push("/");
    },
    routerHandle(val) {
      this.$router.push("/" + val);
    },
  },
};
</script>
<style scoped lang="scss">
.head-box {
  width: 100%;
  z-index: 999;
}

.hea-top {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  color: #fff;
  font-family: "BebasFont";
  mix-blend-mode: difference;
  z-index: 99;
}

.right-btn {
  cursor: pointer;
  width: 4rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 8rem;
  align-items: center;
  padding: 0 1rem;
}

.nav-list {
  position: fixed;
  top: 0;
  color: #fff;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-gap: 4rem;
  background: #000;
  padding-top: 6rem;
  z-index: 1;
}

.nav-i {
  cursor: pointer;
  width: 100%;
  font-size:4rem;
  // background-color: blue;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-i:hover {
  font-weight: 500;
}

.top-img {
  height: 6rem;
  display: flex;
  align-items: center;
}

.imgstyle {
  width: 25rem;
}



.show-nav {
  animation-name: show;
  animation-duration: 2s;
}

@keyframes show {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
</style>